<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="site.service.weibo.*,
				site.service.WeiboUserInfoRepository,
				site.entity.*,
				java.util.*,
				java.text.SimpleDateFormat" %>

<%
	List<WeiboUserInfo> weiboUserInfoList = WeiboUserInfoRepository.getAll();
	List<Weibo> weiboMessageList = WeiboMessageListGenerator
			.generateLatestMessageList(weiboUserInfoList, 2);
	StringBuffer buffer = new StringBuffer();
	for (int i = 0; i < weiboMessageList.size(); i++) {
		buffer.append("<div class=\"weibo\">"
				+ "<div class=\"weibo_title\">"
				+ "<div class=\"weibo_img\">" + "<img width=\"57\" src=\"");
		buffer.append(weiboMessageList.get(i).getImageURL());
		buffer.append("\"></div>" + "<div class=\"weibo_info\">"
				+ "<div class=\"weibo_user\">");
		buffer.append(weiboMessageList.get(i).getUserName());
		buffer.append("</div><div class=\"weibo_time\">");
		//buffer.append(weiboMessageList.get(i).getPostTime());
		buffer.append("发布时间:"+new SimpleDateFormat("yyyy-MM-dd HH:MM").format(weiboMessageList.get(i).getPostTime()));
		buffer.append("</div></div></div><div class=\"weibo_content\" title=\"");
		buffer.append(weiboMessageList.get(i).getMessage());
				buffer.append("\">");
		buffer.append(weiboMessageList.get(i).getMessageAbstract());
		buffer.append("</div></div>");
	}
	String htmlString = buffer.toString();
	buffer = null;
	out.print(htmlString);

	//System.out.println(htmlString);
%>